from django import forms
from django.contrib.auth.models import User

"""
   Form for login page, this form has needed fields in login
   
   This class extends an ModelForm, that is an Django class  
"""
class LoginForm(forms.ModelForm):
    
    # Extra Fields
    keep_conected = forms.BooleanField()
    
    def __init__(self,*args, **kwrds):
        super(LoginForm,self).__init__(*args, **kwrds)
        
        self.fields['password'].widget.attrs['max-size']='75'
        
    class Meta:
        model = User
        fields = ('email','password')
        
    password = forms.CharField(max_length=128, widget=forms.PasswordInput, required=True)
